package huawei;
/*
* @Author: wanghongfucoder
* @Date:   2017-06-28 09:28:40
* @Last Modified by:   wanghongfucoder
* @Last Modified time: 2017-06-28 09:29:06
*/

import java.util.*;
public class Btyecount {
    public static void main(String[] args){
        Scanner in = new Scanner(System.in);
        while(in.hasNext()){
            int n = in.nextInt();
            String s = Integer.toBinaryString(n);
            int count =1;
            int max = 0;
            for(int i=0;i<s.length();i++){
                for(int j=i+1;j<s.length();j++){
                    if(s.charAt(i) == '1' && s.charAt(i) == s.charAt(j)){
                        count++;
                    }else{
                        break;
                    }
                }
                max = count >= max? count: max;
                count = 1;
            }
            System.out.println(max);
        }
        in.close();
    }
}